import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-11-18
 * 19:10
 */
public class Test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n=scan.nextInt();
        int count=0;
        for(int i=1;i<=n;i++){
            boolean ji=true;//是不是奇数位
            int ret=i;
            while(ret!=0){

                if(ret%10%2==0&&ji==true){//奇数位是偶数
                    break;
                }
                if(ret%10%2!=0&&ji==false){//偶数位是奇数
                    break;
                }
                if(ret%10%2!=0&&ji==true) {//奇数位是奇数
                    ret /= 10;
                    ji = false;
                    if(ret==0){
                        count++;
                    }
                }else if(ret%10%2==0&&ji==false){//偶数位是偶数
                    ret/=10;
                    ji=true;
                    if(ret==0){
                        count++;
                    }
                }
            }

        }
        System.out.println(count);
        scan.close();
    }
}
